<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class UserTaskOver extends Model
{
    protected  $table = 'usertaskoverlog';
    private static $suffix;
    public $timestamps = false;

    public function __construct( $suffix = null )
    {
        $this->setConnection('mysql_userlog');
        if(!$suffix){
            $suffix = date('Ym');
        }
        self::setTable($this->table.$suffix);
        parent::__construct();
    }

    public static function query($suffix = null)
    {
        if(!$suffix){
            return parent::query();
        }
        $instance = new self;
        echo $instance->table .= $suffix;
        return $instance->newQuery();
    }
}
